// API 基础路径
// global.API_BASE_PATH = "https://wap.nobuyme.com/nobuy-web"
// global.WEB_BASE_PATH = "https://wap.nobuyme.com/#/"
// 测试接口
// global.API_BASE_PATH = "http://192.168.0.3:80/nobuy-web"
global.API_BASE_PATH = "http://test.nobuyme.com/nobuy-web"
global.WEB_BASE_PATH = "http://test.nobuyme.com/#/"

// 登录URI
global.LOGIN_URI = "/wxapp/login"

// 图片基础路径
global.IMG_BASE_PATH = "https://image.nobuyme.com/"

// 应用名称
global.APP_NAME = "housing_life"

// 应用标题 
global.APP_TITLE = "正好"

// 加密秘钥
global.APP_SECRET_KEY = ""

// 版本号
global.APP_VERSION = "1.0.0"
global.APP_AUTHOR = "kigare <741345433@qq.com>"
// 分页大小
global.PAGE_SIZE =  10

//主题颜色
const PRIMARY_COLOR = '#ff1010';

//错误提示
global.showError = function (message, success){
  if (!message) return;
  success = success || function(){}
  wx.showToast({
    title: message,
    icon: 'none',
    duration: 1500
  })
};

/**
 * 确认框
 */
global.showConfirm = function(config){
  config.confirmColor = config.confirmColor || PRIMARY_COLOR;
  config.cancelColor = config.cancelColor || PRIMARY_COLOR;
  wx.showModal(config)
}

//Toast
global.toast = function (message) {
  if(!message) return;
  wx.showToast({
    title: message,
    icon: 'none',
    duration: 1500
  })
};
//成功toast
global.successToast = function (message) {
  wx.showToast({
    icon: 'success',
    title: message
  })
};
//loading
global.showLoading = function(message){
  wx.showLoading({
    mask: false,
    title: message || ''
  });
};

//hideLoading
global.hideLoading = function(){
  wx.hideLoading();
}

module.exports = {}
